//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.tuliu.appupdate.updatelib;

import android.content.Context;
import android.content.res.Resources.NotFoundException;
import android.text.TextUtils;
import java.lang.reflect.Field;
import java.util.HashMap;

class RHelper {
    private static HashMap<String, String> sStringCache = new HashMap();

    RHelper() {
    }

    static String getString(Context context, String resName) {
        String value = (String)sStringCache.get(resName);
        if(TextUtils.isEmpty(value)) {
            throw new NotFoundException("没有找到对应的字符串资源(" + resName + ")，请确保已经将res目录下对应的.xml文件拷贝到你的工程中");
        } else {
            return value;
        }
    }

    static String getString(Context context, String resName, Object... formatArgs) {
        String value = (String)sStringCache.get(resName);
        if(TextUtils.isEmpty(value)) {
            throw new NotFoundException("没有找到对应的字符串资源(" + resName + ")，请确保已经将res目录下对应的.xml文件拷贝到你的工程中");
        } else {
            return String.format(value, formatArgs);
        }
    }

    static int getStringResId(Context context, String resName) {
        try {
            String e = context.getPackageName();
            String androidRuntimeException1 = e + ".R$string";
            Class RClass = Class.forName(androidRuntimeException1);
            Field field = RClass.getField(resName);
            int modifiers = field.getModifiers();
            if(field.getType().isAssignableFrom(Integer.TYPE) && (modifiers & 16) != 0 && (modifiers & 1) != 0 && (modifiers & 8) != 0) {
                return field.getInt(RClass);
            } else {
                throw new NotFoundException("没有找到对应的字符串资源(" + resName + ")，请确保已经将res目录下对应的.xml文件拷贝到你的工程中");
            }
        } catch (Exception var7) {
            NotFoundException androidRuntimeException = new NotFoundException("没有找到对应的字符串资源(" + resName + ")，请确保已经将res目录下对应的.xml文件拷贝到你的工程中");
            androidRuntimeException.initCause(var7);
            throw androidRuntimeException;
        }
    }

    static {
        sStringCache.put("appstore_title", "360手机助手");
        sStringCache.put("appstore_notification_title_found_new_version", "%1$s有新版本了");
        sStringCache.put("appstore_notification_message_found_new_version_speed", "V%1$s，大小：%2$s");
        sStringCache.put("appstore_notification_message_found_new_version_patch", "V%1$s，可省流量%2$s");
        sStringCache.put("appstore_notification_title_apk_download_ok", "更新下载成功");
        sStringCache.put("appstore_notification_message_apk_download_ok", "%s下载成功");
        sStringCache.put("appstore_notification_title_apk_download_fail", "更新下载失败");
        sStringCache.put("appstore_notification_message_apk_download_fail", "%s下载失败");
        sStringCache.put("appstore_notification_tickertext_apk_downloading", "正在下载更新");
        sStringCache.put("appstore_notification_title_apk_downloading", "更新中...");
        sStringCache.put("appstore_notification_message_apk_downloading", "正在下载%s");
        sStringCache.put("appstore_update", "直接更新");
        sStringCache.put("appstore_dialog_title_found_new_version", "发现新版本 %1$s");
        sStringCache.put("appstore_dialog_message_update", "更新内容:\n%1$s\n\n更新包大小:%2$s\n使用360手机助手省流量更新仅需要%3$s\n建议更新");
        sStringCache.put("appstore_dialog_message_update_patch", "更新内容:\n%1$s\n\n更新包大小:%2$s");
        sStringCache.put("appstore_dialog_message_update_normal", "更新内容:\n%1$s\n\n更新包大小:%2$s");
    }
}
